
import { Provide, Inject } from '@midwayjs/core';
import { TeacherVolunteerTeamDao } from '@dao/teacherVolunteerTeam.dao';
import {
  CreateTeacherVolunteerDto,
  UpdateTeacherVolunteerDto,
  QueryTeacherVolunteerDto,
  DeleteTeacherVolunteerDto,
} from '@dto/teacherVolunteerTeam.dto';

@Provide()
export class TeacherVolunteerTeamService {
  @Inject()
  teacherVolunteerTeamDao: TeacherVolunteerTeamDao;

  /**
   * 创建/更新教师志愿
   */
  async create(body: CreateTeacherVolunteerDto) {
    return await this.teacherVolunteerTeamDao.create(body);
  }

  /**
   * 更新教师志愿
   */
  async update(body: UpdateTeacherVolunteerDto) {
    return await this.teacherVolunteerTeamDao.update(body);
  }

  /**
   * 获取教师志愿列表
   */
  async list(query: QueryTeacherVolunteerDto) {
    return await this.teacherVolunteerTeamDao.list(query);
  }

  /**
   * 获取教师志愿详情
   */
  async getVolunteerDetail(teacherId: number) {
    return await this.teacherVolunteerTeamDao.getVolunteerDetail(teacherId);
  }




  /**
   * 获取教师在某个分组的志愿详情
   */
  async detail(groupId: number, teacherId: number) {
    return await this.teacherVolunteerTeamDao.detail(groupId, teacherId);
  }

  /**
   * 删除教师的某些志愿
   */
  async remove(deleteDto: DeleteTeacherVolunteerDto) {
    return await this.teacherVolunteerTeamDao.remove(deleteDto);
  }

  /**
   * 删除教师在某个分组的所有志愿
   */
  async removeAll(groupId: number, teacherId: number) {
    return await this.teacherVolunteerTeamDao.removeAll(groupId, teacherId);
  }
}
